package com.ws.boot.demo.validate.service.method.parameter;


import com.ws.boot.demo.validate.entity.IdCard;
import com.ws.boot.demo.validate.entity.Person;
import com.ws.boot.demo.validate.entity.Person4;
import com.ws.boot.validate.annotation.ValidComponent;
import com.ws.boot.validate.annotation.constraint.Checker;
import com.ws.boot.web.domain.DefaultResponse;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Map;

/**
 * 方法参数 业务类 ： Checker 嵌套集合 .
 *
 * @className: MethodParameterForCheckerCollectionService
 * @author: ws
 * @date: 2020/4/3 16:22
 * @version: 1.0.0
 */
@ValidComponent
public interface MethodParameterForCheckerCollectionService {


    /**
     * map 单层泛型 .
     * @param map
     * @author ws
     * @date 2020/4/2 14:20
     * @return DefaultResponse
     **/
    DefaultResponse map(@NotNull @Size(min = 2) Map<@NotBlank String, @Checker Person> map);

    /**
     * list 单层泛型 .
     * @param list
     * @author ws
     * @date 2020/4/2 14:23
     * @return DefaultResponse
     **/
    DefaultResponse list(@NotNull @Size(min = 1, max = 3) List<@Checker IdCard> list);

    /**
     * list 双层泛型 .
     * @param list
     * @author ws
     * @date 2020/4/14 13:50
     * @return DefaultResponse
     **/
    DefaultResponse list2Level(@NotEmpty List<@NotEmpty(message = "内部list不能为空")
    @Size(min = 2, message = "内部集合长度最小为2") List<@NotBlank(message = "内部集合字符串不能为空") String>> list);

    /**
     * map 双层泛型 .
     * @param map
     * @author ws
     * @date 2020/4/14 14:34
     * @return DefaultResponse
     **/
    DefaultResponse map2Level(@NotEmpty Map<String
            , @NotEmpty(message = "内部map不能为空") @Size(min = 3, message = "内部map大小至少3")
            Map<String, @NotBlank(message = "内部内部值不能为空") String>> map);

    /**
     * list map 三层泛型嵌套 Checker .
     * @param list
     * @author ws
     * @date 2020/4/14 15:10
     * @return DefaultResponse
     **/
    DefaultResponse listMapChecker3Level(@NotEmpty List<@Size(min = 1, max = 2)
            Map<@NotNull(message = "key 不能为空") String, @NotEmpty @Size(min = 3) List<@Checker Person4>>> list);

}
